package com.googlecode.autopp;

import com.googlecode.autopp.conf.ExceptionStrategy;
import com.googlecode.autopp.conf.NestingStrategy;

/**
 * Interface for all driver implementations.
 */
public interface Driver {

    /**
     * Creates and populates object of given type.
     * 
     * @param <T>
     *            Type of created object.
     * @param objectContext
     *            Type of created object and other information wrapped into
     *            context object.
     * 
     * @return Populated object.
     */
    <T> T createAndPopulateObject(ObjectContext<T> objectContext);

    /**
     * Sets algorithm for nesting objects.
     * 
     * @param strategy
     *            Algorithm for handling nesting objects.
     */
    void setNestingStrategy(NestingStrategy strategy);

    /**
     * Sets algorithm for exception handling.
     * 
     * @param strategy
     *            Algorithm for handling exceptions.
     */
    void setExceptionStrategy(ExceptionStrategy strategy);
}
